package ronglei.day01.demo07String;

import java.util.Scanner;

/*
* 键盘输入一个字符串，并且统计各个种类出现字符出现的次数
* 种类  大写小写数字其他
* */
public class String08 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入字符");
        String str1 = scanner.next();


        int daxie = 0;
        int xiaoxie = 0;
        int shuzi = 0;
        int qita = 0;

        char[] chars = str1.toCharArray();
        for (int i = 0; i < chars.length; i++) {
             char ch = chars[i];
             if('a'<=ch && ch<='z'){
                 xiaoxie++;
             }else if ('A'<=ch && ch<='Z'){
                 daxie++;
             }else if('0'<=ch && ch<='9'){
                 shuzi++;
             }else{
                 qita++;
             }
        }
        System.out.println(daxie);
        System.out.println(xiaoxie);
        System.out.println(shuzi);
        System.out.println(qita);
    }
}
